//读取cookie的值
function getCookie(name) {
    var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
    if (arr = document.cookie.match(reg)) return decodeURI(arr[2]);
    else return null;
}

//读取URL中参数的值
function getParam(name) {
    var tUrl = document.location.toString().toLowerCase();
    var re = new RegExp("(\\\?|&)" + name.toLowerCase() + "=([^&]+)(&|$)");
    var tArr = tUrl.match(re);
    if (tArr) return decodeURIComponent(tArr[2]);
    else return "";
}